package wsi.function;

import org.rygh.core.face.IHasName;
import org.rygh.semantic.model.rdf.Entity;
import org.rygh.semantic.model.rdf.Fact;

public class Parameter implements IHasName {

	private final String name;
	private Entity type;
	private Fact filterFact;

	public Parameter(String name) {
		this.name = name;
	}

	public Fact getFilterFact() {
		return filterFact;
	}

	@Override
	public String getName() {
		return name;
	}

	public Entity getType() {
		return type;
	}

	public void setFilterFact(Fact filterFact) {
		this.filterFact = filterFact;
	}

	public void setType(Entity type) {
		this.type = type;
	}

	@Override
	public String toString() {
		if (type != null)
			return String.format("%s:%s", name, type);
		else if (filterFact != null)
			return String.format("%s:{%s}", name, filterFact);
		else {
			return "";
		}
	}
}
